home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / libx11 / include / x11 / extensions / multibuf.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  8KB  |  281 lines

  1. /*
  2.  * $XConsortium: multibuf.h,v 1.15 91/07/12 10:20:42 rws Exp $
  3.  *
  4.  * Copyright 1989 Massachusetts Institute of Technology
  5.  *
  6.  * Permission to use, copy, modify, distribute, and sell this software and its
  7.  * documentation for any purpose is hereby granted without fee, provided that
  8.  * the above copyright notice appear in all copies and that both that
  9.  * copyright notice and this permission notice appear in supporting
  10.  * documentation, and that the name of M.I.T. not be used in advertising or
  11.  * publicity pertaining to distribution of the software without specific,
  12.  * written prior permission.  M.I.T. makes no representations about the
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  17.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
  18.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  20.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
  21.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22.  */
  23.  
  24. #ifndef _MULTIBUF_H_
  25. #define _MULTIBUF_H_
  26.  
  27. #include <X11/Xfuncproto.h>
  28.  
  29. #define MULTIBUFFER_PROTOCOL_NAME "Multi-Buffering"
  30.  
  31. #define MULTIBUFFER_MAJOR_VERSION    1    /* current version numbers */
  32. #define MULTIBUFFER_MINOR_VERSION    0
  33.  
  34. #define X_MbufGetBufferVersion        0
  35. #define X_MbufCreateImageBuffers    1
  36. #define X_MbufDestroyImageBuffers    2
  37. #define X_MbufDisplayImageBuffers    3
  38. #define X_MbufSetMBufferAttributes    4
  39. #define X_MbufGetMBufferAttributes    5
  40. #define X_MbufSetBufferAttributes    6
  41. #define X_MbufGetBufferAttributes    7
  42. #define X_MbufGetBufferInfo        8
  43. #define X_MbufCreateStereoWindow    9
  44.  
  45. /*
  46.  * update_action field
  47.  */
  48. #define MultibufferUpdateActionUndefined    0
  49. #define MultibufferUpdateActionBackground    1
  50. #define MultibufferUpdateActionUntouched    2
  51. #define MultibufferUpdateActionCopied        3
  52.  
  53. /*
  54.  * update_hint field
  55.  */
  56. #define MultibufferUpdateHintFrequent        0
  57. #define MultibufferUpdateHintIntermittent    1
  58. #define MultibufferUpdateHintStatic        2
  59.  
  60. /*
  61.  * valuemask fields
  62.  */
  63. #define MultibufferWindowUpdateHint    (1L << 0)
  64. #define MultibufferBufferEventMask    (1L << 0)
  65.  
  66. /*
  67.  * mono vs. stereo and left vs. right
  68.  */
  69. #define MultibufferModeMono        0
  70. #define MultibufferModeStereo        1
  71. #define MultibufferSideMono        0
  72. #define MultibufferSideLeft          1
  73. #define MultibufferSideRight        2
  74.  
  75. /*
  76.  * clobber state
  77.  */
  78. #define MultibufferUnclobbered        0
  79. #define MultibufferPartiallyClobbered    1
  80. #define MultibufferFullyClobbered    2
  81.  
  82. /*
  83.  * event stuff
  84.  */
  85. #define MultibufferClobberNotifyMask    0x02000000
  86. #define MultibufferUpdateNotifyMask    0x04000000
  87.  
  88. #define MultibufferClobberNotify    0
  89. #define MultibufferUpdateNotify        1
  90. #define MultibufferNumberEvents        (MultibufferUpdateNotify + 1)
  91.  
  92. #define MultibufferBadBuffer        0
  93. #define MultibufferNumberErrors        (MultibufferBadBuffer + 1)
  94.  
  95.  
  96. #ifndef _MULTIBUF_SERVER_
  97. /*
  98.  * Extra definitions that will only be needed in the client
  99.  */
  100. typedef XID Multibuffer;
  101.  
  102. typedef struct {
  103.     int    type;            /* of event */
  104.     unsigned long serial;   /* # of last request processed by server */
  105.     int send_event;        /* true if this came frome a SendEvent request */
  106.     Display *display;        /* Display the event was read from */
  107.     Multibuffer buffer;        /* buffer of event */
  108.     int    state;            /* see Clobbered constants above */
  109. } XmbufClobberNotifyEvent;
  110.  
  111. typedef struct {
  112.     int    type;            /* of event */
  113.     unsigned long serial;   /* # of last request processed by server */
  114.     int send_event;        /* true if this came frome a SendEvent request */
  115.     Display *display;        /* Display the event was read from */
  116.     Multibuffer buffer;        /* buffer of event */
  117. } XmbufUpdateNotifyEvent;
  118.  
  119.  
  120. /*
  121.  * per-window attributes that can be got
  122.  */
  123. typedef struct {
  124.     int displayed_index;    /* which buffer is being displayed */
  125.     int update_action;        /* Undefined, Background, Untouched, Copied */
  126.     int update_hint;        /* Frequent, Intermittent, Static */
  127.     int window_mode;        /* Mono, Stereo */
  128.     int nbuffers;        /* Number of buffers */
  129.     Multibuffer *buffers;    /* Buffers */
  130. } XmbufWindowAttributes;
  131.  
  132. /*
  133.  * per-window attributes that can be set
  134.  */
  135. typedef struct {
  136.     int update_hint;        /* Frequent, Intermittent, Static */
  137. } XmbufSetWindowAttributes;
  138.  
  139.  
  140. /*
  141.  * per-buffer attributes that can be got
  142.  */
  143. typedef struct {
  144.     Window window;        /* which window this belongs to */
  145.     unsigned long event_mask;    /* events that have been selected */
  146.     int buffer_index;        /* which buffer is this */
  147.     int side;            /* Mono, Left, Right */
  148. } XmbufBufferAttributes;
  149.  
  150. /*
  151.  * per-buffer attributes that can be set
  152.  */
  153. typedef struct {
  154.     unsigned long event_mask;    /* events that have been selected */
  155. } XmbufSetBufferAttributes;
  156.  
  157.  
  158. /*
  159.  * per-screen buffer info (there will be lists of them)
  160.  */
  161. typedef struct {
  162.     VisualID visualid;        /* visual usuable at this depth */
  163.     int max_buffers;        /* most buffers for this visual */
  164.     int depth;            /* depth of buffers to be created */
  165. } XmbufBufferInfo;
  166.  
  167. _XFUNCPROTOBEGIN
  168.  
  169. extern Bool XmbufQueryExtension(
  170. #if NeedFunctionPrototypes
  171.     Display*        /* dpy */,
  172.     int*        /* event_base_return */,
  173.     int*        /* error_base_return */
  174. #endif
  175. );
  176.  
  177. extern Status XmbufGetVersion(
  178. #if NeedFunctionPrototypes
  179.     Display*        /* dpy */,
  180.     int*        /* major_version_return */,
  181.     int*        /* minor_version_return */
  182. #endif
  183. );
  184.  
  185. extern int XmbufCreateBuffers(
  186. #if NeedFunctionPrototypes
  187.     Display*        /* dpy */,
  188.     Window        /* w */,
  189.     int            /* count */,
  190.     int            /* update_action */,
  191.     int            /* update_hint */,
  192.     Multibuffer*    /* buffers */
  193. #endif
  194. );
  195.  
  196. extern void XmbufDestroyBuffers(
  197. #if NeedFunctionPrototypes
  198.     Display*        /* dpy */,
  199.     Window        /* window */
  200. #endif
  201. );
  202.  
  203. extern void XmbufDisplayBuffers(
  204. #if NeedFunctionPrototypes
  205.     Display*        /* dpy */,
  206.     int            /* count */,
  207.     Multibuffer*    /* buffers */,
  208.     int            /* min_delay */,
  209.     int            /* max_delay */
  210. #endif
  211. );
  212.  
  213. extern Status XmbufGetWindowAttributes(
  214. #if NeedFunctionPrototypes
  215.     Display*            /* dpy */,
  216.     Window            /* w */,
  217.     XmbufWindowAttributes*    /* attr */
  218. #endif
  219. );
  220.  
  221. extern void XmbufChangeWindowAttributes(
  222. #if NeedFunctionPrototypes
  223.     Display*            /* dpy */,
  224.     Window            /* w */,
  225.     unsigned long        /* valuemask */,
  226.     XmbufSetWindowAttributes*    /* attr */
  227. #endif
  228. );
  229.  
  230. extern Status XmbufGetBufferAttributes(
  231. #if NeedFunctionPrototypes
  232.     Display*            /* dpy */,
  233.     Multibuffer            /* b */,
  234.     XmbufBufferAttributes*    /* attr */
  235. #endif
  236. );
  237.  
  238. extern void XmbufChangeBufferAttributes(
  239. #if NeedFunctionPrototypes
  240.     Display*            /* dpy */,
  241.     Multibuffer            /* b */,
  242.     unsigned long        /* valuemask */,
  243.     XmbufSetBufferAttributes*    /* attr */
  244. #endif
  245. );
  246.  
  247. extern Status XmbufGetScreenInfo(
  248. #if NeedFunctionPrototypes
  249.     Display*            /* dpy */,
  250.     Drawable            /* d */,
  251.     int*            /* nmono_return */,
  252.     XmbufBufferInfo**        /* mono_info_return */,
  253.     int*            /* nstereo_return */,
  254.     XmbufBufferInfo**        /* stereo_info_return */
  255. #endif
  256. );
  257.  
  258. extern Window XmbufCreateStereoWindow(
  259. #if NeedFunctionPrototypes
  260.     Display*            /* dpy */,
  261.     Window            /* parent */,
  262.     int                /* x */,
  263.     int                /* y */,
  264.     unsigned int        /* width */,
  265.     unsigned int        /* height */,
  266.     unsigned int        /* border_width */,
  267.     int                /* depth */,
  268.     unsigned int        /* class */,
  269.     Visual*            /* visual */,
  270.     unsigned long        /* valuemask */,
  271.     XSetWindowAttributes*    /* attr */,
  272.     Multibuffer*        /* leftp */,
  273.     Multibuffer*        /* rightp */
  274. #endif
  275. );
  276.  
  277. _XFUNCPROTOEND
  278.  
  279. #endif /* _MULTIBUF_SERVER_ */
  280. #endif /* _MULTIBUF_H_ */
  281.